package org.jiuling.weather.config;

import org.jiuling.aliyunmarket.config.AliyunMarketConfig;
import org.jiuling.aliyunmarket.moji.util.MojiWeather;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

/**
 * 墨迹天气Bean配置
 * @author 紫灵
 * @date 2022年09月14日 16时15分56秒
 */
@Component
@Configuration
public class MojiWeatherBeanConfig {

    @Bean
    @ConfigurationProperties(prefix = "jiu-ling.aliyun.market")
    public AliyunMarketConfig aliyunMarketConfig(){
        return new AliyunMarketConfig();
    }

    @Bean
    public MojiWeather mojiWeather(){
        return new MojiWeather(aliyunMarketConfig());
    }

}
